<script setup>
defineProps({
  icon:Object,
  title:String,
  desc:String
})

</script>

<template>
  <div class="card">
    <div v-if="title" class="card-header">
      <div>
        <el-icon style="margin-right: 5px;translate:0 2px ">
          <component :is="icon" />
        </el-icon>
        {{title}}

      </div>
      <div>
        {{desc}}
      </div>
    </div>
    <slot></slot>
  </div>

</template>

<style scoped>
.card {
  background-color: var(--el-bg-color);
  border-radius: 5px;
  border: solid px var(--el-border-color);
  padding: 10px;
  min-height: 20px;
}
.card-header {
  border-bottom: solid 1px var(--el-border-color);
  padding: 5px;
  margin-bottom: 10px;
  &>:first-child{
    font-size: 16px;
    font-weight: bold;
  }
  &>:last-child{
    font-size: 12px;
    color: var(--el-text-color-secondary);
  }
}

</style>